import React, { Component } from 'react'
import RouterView from '../router'
import { Link } from 'react-router-dom'

export default class Home extends Component {
    state = {
        list: [
            {
                title: "首页",
                path: "/home/homes"
            },
            {
                title: "应用",
                path: "/home/app"
            },
            {
                title: "我的",
                path: "/home/my"
            }
        ]
    }
    render() {
        const { child } = this.props
        const { list } = this.state
        return (
            <div>
                {
                    list.map((item, index) => {
                        return <Link to = { item.path } key = { index }>
                            { item.title }
                        </Link>
                    })
                }
                <RouterView routerList = { child }/>
            </div>
        )
    }
}
